﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MapEditor
{
    public class Tile
    {
        private int[] tabLayer;
        public int fg
        {
            get { return tabLayer[0]; }
            set { tabLayer[0] = value; }
        }
        public int o
        {
            get { return tabLayer[1]; }
            set { tabLayer[1] = value; }
        }
        public int bg
        {
            get { return tabLayer[2]; }
            set { tabLayer[2] = value; }
        }
        public int c
        {
            get { return tabLayer[3]; }
            set { tabLayer[3] = value; }
        }

        public Tile(int fg, int o, int bg, int c)
        {
            tabLayer = new int[4];
            tabLayer[0] = fg;
            tabLayer[1] = o;
            tabLayer[2] = bg;
            tabLayer[3] = c;
        }

        public int this[int v]
        {
            set { if (v < 4 && v >= 0) tabLayer[v] = value; }
            get { if (v < 4 && v >= 0) return tabLayer[v]; else return -2; }
        }
    }
}
